package com.star.chain.test;

import com.star.chain.leader.Leader;
import com.star.chain.leader.impl.ALeader;
import com.star.chain.leader.impl.BLeader;
import com.star.chain.leader.impl.CEOLeader;
import com.star.chain.leader.impl.CLeader;
import com.star.chain.model.ApplyModel;

/**
 * @author: liminghui
 * @date: 2021/6/9 8:29
 * @version: 1.0
 * @description: 测试责任链模式 A-B-C-CEO
 */
public class ClientApplyService {

    public static void main(String[] args) {
        ApplyModel applyModel = new ApplyModel();
        applyModel.setApplyName("阿粉");
        applyModel.setContent("申请涨薪");
        applyModel.setSalary(1550);

        Leader aLeader = new ALeader();
        Leader bLeader = new BLeader();
        Leader cLeader = new CLeader();
        Leader ceoLeader = new CEOLeader();
        aLeader.setLeader(bLeader);
        bLeader.setLeader(cLeader);
        cLeader.setLeader(ceoLeader);

        aLeader.handlerApply(applyModel);
    }
}